package com.fengxing.ams.web.task.translator;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.fengxing.ams.pub.AMSException;

public class PoliticalTranslator implements Translator {

	private static final Map<String, String> cache = new HashMap<String, String> ();
	static {
		cache.put("01","中共党员");
		cache.put("02","中共预备党员");
		cache.put("03","共青团员");
		cache.put("04","民革会员");
		cache.put("05","民盟盟员");
		cache.put("06","民建会员");
		cache.put("07","民进会员");
		cache.put("08","农工党党员");
		cache.put("09","致公党党员");
		cache.put("10","九三学社社员");
		cache.put("11","台盟盟员");
		cache.put("12","无党派民主人士");
		cache.put("13","群众");
	}
	private static final String message = "期望值："+StringUtils.join(cache.keySet(), '|')+"， 而实际值：";
	@Override
	public String translate(String input) {
		if (!cache.containsKey(input))
			throw new AMSException(message+input);
		return cache.get(input);
	}

}
